package com.student.recruitment.app.service;

import java.util.List;
import javax.transaction.Transactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.student.recruitment.app.dao.EmployeeDAO;
import com.student.recruitment.app.entity.EmployeeEntity;

@Service
public class EmployeeManagerImpl implements EmployeeManager
{
    @Autowired
    private EmployeeDAO employeeDAO;
    
    
    @Override
    @Transactional
    public void addEmployee(EmployeeEntity employee) {
        employeeDAO.addEmployee(employee);
    }
    
    @Override
    @Transactional
    public List<EmployeeEntity> getAllEmployees() {
    	
    return employeeDAO.getAllEmployees();
        
    }
    @Override
    @Transactional
    public void deleteEmployee(Integer employeeId) {
        employeeDAO.deleteEmployee(employeeId);
    }
    @Override
    @Transactional
    public void editEmployee(EmployeeEntity employee) {
        employeeDAO.editEmployee(employee);
    }
    @Override
    @Transactional
    public EmployeeEntity getEmployee(Integer employeeId) {
        return employeeDAO.getEmployee(employeeId);
    }

	@Override
	@Transactional
	public List<EmployeeEntity> getMyCriteriaRecords(String kryteria,
			String nazwa) {
		employeeDAO.getMyCriteriaRecords(kryteria, nazwa);
		return employeeDAO.getMyCriteriaRecords(kryteria, nazwa);
	}

	@Override
	@Transactional
	public String getEmployeeStatus(String username) {
		
		return employeeDAO.getEmployeeStatus(username);
	}

	@Override
	@Transactional
	public void acceptEmployee(Integer employeeId) {
		employeeDAO.acceptEmployee(employeeId);
		
	}

	
	@Override
	@Transactional
	public List<EmployeeEntity> SortResultsDirectionOfPoints(String direction, int points) {
		
		employeeDAO.SortResultsDirectionOfPoints(direction, points);
		return employeeDAO.SortResultsDirectionOfPoints(direction, points);
	}
	@Override
	@Transactional
	public List<EmployeeEntity> SortResultsDirectionOfAmount(String direction, int ilosc) {
		
		employeeDAO.SortResultsDirectionOfAmount(direction, ilosc);
		return employeeDAO.SortResultsDirectionOfAmount(direction, ilosc);
	}

	@Override
	@Transactional
	public EmployeeEntity getEmployeeData(String username) {
		return employeeDAO.getEmployeeData(username);
	}

	@Override
	@Transactional
	public int getEmployeePoints(String username) {
		
		return employeeDAO.getEmployeePoints(username);
	}
	
	
}